package com.woniuxy.education.mapper;

import com.woniuxy.education.entity.*;
import org.apache.ibatis.annotations.*;

import java.util.List;


public interface SchoolMapper {

    //查询学校信息
    @Select("select * from all_school,user where user.id=all_school.uid")
    public List<Allschool> findAllSchool();

    //通过账号密码查询学校
    @Select("select * from all_school,user where school_account=#{school_account}and school_password=#{school_password}")
    public Allschool findSchool(@Param("school_account") String school_account,@Param("school_account") String school_password);

    //修改学校账号密码
    @Update("update all_school set school_password = #{school_password} where id = #{id}")
    public int updateSchool(@Param("id") int id,@Param("school_password") String school_password);

    //修改校长账号密码
    @Update("update user set password = #{password} where id = #{uid}")
    public int updateSchoolMsater(@Param("uid") int uid,@Param("password") String password);

    //查询升学数据
    @Select("select c.id,c.entrance_num,c.all_num,c.year,c.sid,a.school_name " +
            "from school_contrast as c,all_school as a where c.sid=a.id ")
    public List<School_Contrast> findAllSchoolContrast();

}
